<?php
//call library
require_once('lib/nusoap.php');
$URL       = "demo.dev/nusoap";
$namespace = $URL . '?wsdl';
//using soap_server to create server object
$server    = new soap_server;
$server->configureWSDL('hellotesting', $namespace);

//register a function that works on server
$server->register('hello');

// create the function
function hello($name)
{
    if (!$name) {
        return new soap_fault('Client', '', 'Put your name!');
    }
    $result = "Hello, " . $name;
    return $result;
}
// create HTTP listener
$HTTP_RAW_POST_DATA = isset($HTTP_RAW_POST_DATA) ? $HTTP_RAW_POST_DATA : '';
$server->service($HTTP_RAW_POST_DATA);
?>